﻿

#region File Description

// Conversion class. Swaps data between the main editor class and the
// storage class Editor Prototype. Gap between classes is deliberately maintained
// to ease serialization debugging and management.
#endregion


#region Using Statements

// System References
using System;
using System.Collections.Generic;
using System.Linq;

// XNA References
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

// Freeform References
using Freeform.Framework;
using Freeform.Framework.Graphics;
using Freeform.Framework.Utility;
using Freeform.Framework.Input;
using Freeform.Framework.Menu;

// Internal References

#endregion


namespace CardGame.Adventure.Editor
{
    public static class ConversionClass
    {
        public static EditorProtoClass ToProtoClass(EditorTileClass TileClass)
        {
            return
                new EditorProtoClass
                {
                    TileHeight = TileClass.TileHeight,
                    TileWidth = TileClass.TileWidth,
                    ArtFileName = TileClass.ArtFileName,
                    MapHeight = TileClass.MapHeight,
                    MapWidth = TileClass.MapWidth,
                    MapGrid = TileClass.MapGrid
                };
        }

        public static EditorTileClass ToTileClass(EditorProtoClass ProtoClass, EditorTileClass ExistingEditor)
        {
            ExistingEditor.TileHeight = ProtoClass.TileHeight;
            ExistingEditor.TileWidth = ProtoClass.TileWidth;
            ExistingEditor.ArtFileName = ProtoClass.ArtFileName;
            ExistingEditor.MapHeight = ProtoClass.MapHeight;
            ExistingEditor.MapWidth = ProtoClass.MapWidth;
            ExistingEditor.MapGrid = ProtoClass.MapGrid;

            return ExistingEditor;
        }

        public static TileClass ToAdventureClass(EditorProtoClass ProtoClass, TileClass ExistingTile)
        {
            ExistingTile.ArtFileName = ProtoClass.ArtFileName;
            ExistingTile.MapHeight = ProtoClass.MapHeight;
            ExistingTile.MapWidth = ProtoClass.MapWidth;
            ExistingTile.MapGrid = ProtoClass.MapGrid;

            return ExistingTile;
        }
    }
}
